package com.kuang.demo.mapper.wx;

import com.kuang.demo.bean.wx.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ACG
 * @date 2020-11-04 22:21
 */
public interface ShoppingCartMapper {

    int selectGoodsSum4ShoppingCart();

    List<ShoppingCartIndexData.CartListBean> selectCartList(Integer userId);

    ShoppingCartIndexData.CartTotalBean selectCartTotal(Integer userId);

    Integer updateCheckedByProductId(@Param("shoppingCartCheckedBean") ShoppingCartCheckedBean shoppingCartCheckedBean);

    void updateDeleteByProductId(@Param("shoppingCartCheckedBean") ShoppingCartCheckedBean shoppingCartCheckedBean);

    List<ShoppingCartCheckoutData.CheckedAddressBean> selectCheckedAddressByUserId(@Param("userId") Integer userId);


    List<ShoppingCartCheckoutData.CheckedGoodsListBean> selectCheckedGoodsListByUserId(@Param("userId") Integer userId);

    void InsertIntoShoppingCart( @Param("shoppingGoodsBean") ShoppingCartAddGoodsBean shoppingGoodsBean);

    ShoppingCartAddGoodsBean selectGoodsInformationByGoodsId(@Param("goodsId") Integer goodsId);

    Integer selectShoppingCartId(@Param("goodsId") Integer goodsId);

    void updateShoppingCartGoodsNumberById(@Param("id") Integer id, @Param("number") Integer number);

    String selectGoodsNameByGoodsId(@Param("goodsId") Integer goodsId);

    ShoppingCartCheckoutData.CheckedAddressBean selectCheckedAddreeByAddressId(@Param("addressId") Integer addressId);

    List<ShoppingCartCheckoutData.CheckedGoodsListBean> selectGoodsListByCardId(@Param("cartId") Integer cartId);

    int selectSum4GoodsCheckout(@Param("userId") int userId);

    int selectGoodsSum4GoodsCheckout(@Param("cartId") Integer cartId);

    int selectCountCouponCanUse(@Param("goodsTotalPrice") int goodsTotalPrice);

    Integer selectCouponPrice(@Param("goodsTotalPrice") int goodsTotalPrice);


    List<Integer> selectCouponId(@Param("couponPrice") int couponPrice);

    Integer selectUserIdByUserName(@Param("principal1") String principal1);

    Integer selectGoodsSum(@Param("userId") Integer userId);

    ShoppingCartIndexData.CartTotalBean selectCartTotalAndCheckIsZero(@Param("userId") Integer userId);
}
